from marshmallow import Schema, fields, post_load


class UsersSchema(Schema):
    id = fields.Integer()
    user_name = fields.String()
    password = fields.String()

    @post_load  # 使用post_load来装饰json>object的函数
    def make_user(self, data, **kwargs):
        return UsersSchema(**data)
